//
//  VolunteerRecordViewController.m
//  MemberProject
//
//  Created by macbook on 15/4/13.
//  Copyright (c) 2015年 MAC OS X. All rights reserved.
//

#import "VolunteerRecordViewController.h"
#import "VolunteerRecordTableViewCell.h"
#import "VolunteerInputViewController.h"
@interface VolunteerRecordViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property(strong,nonatomic)NSArray *data;
@end

@implementation VolunteerRecordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"志愿记录";
    self.tableView.dataSource=self;
    self.tableView.delegate=self;
    [self.tableView registerNib:[UINib nibWithNibName:@"VolunteerRecordTableViewCell" bundle:nil] forCellReuseIdentifier:@"CellIdentifier"];
    self.data=@[@"",@""];
    if(self.data.count==0){
        self.tableView.hidden=YES;
    }
    
//    UIBarButtonItem *rightBarButtonItem=[[UIBarButtonItem alloc]initWithTitle:@"添加" style:UIBarButtonItemStyleBordered target:self action:@selector(chickRightBarButton:)];
//    self.navigationItem.rightBarButtonItem=rightBarButtonItem;
}

-(void)chickRightBarButton:(UIBarButtonItem *)sender{
    VolunteerInputViewController *vc=[[VolunteerInputViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

#pragma mark - tableView
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 244;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.data.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *CellIdentifier=@"CellIdentifier";
    VolunteerRecordTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    
    return cell;
}
@end
